package com.visizen.wisdomclass.server.client;

import com.visizen.wisdomclass.server.model.WcVoteType;
import com.visizen.wisdomclass.server.model.WcVoteTypeExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

public interface WcVoteTypeMapper {
    @SelectProvider(type=WcVoteTypeSqlProvider.class, method="countByExample")
    int countByExample(WcVoteTypeExample example);

    @DeleteProvider(type=WcVoteTypeSqlProvider.class, method="deleteByExample")
    int deleteByExample(WcVoteTypeExample example);

    @Delete({
        "delete from wc_vote_type",
        "where ID = #{ID,jdbcType=BIGINT}"
    })
    int deleteByPrimaryKey(Long ID);

    @Insert({
        "insert into wc_vote_type (ID, VOTE_ID, ",
        "TYPE, NAME)",
        "values (#{ID,jdbcType=BIGINT}, #{VOTE_ID,jdbcType=BIGINT}, ",
        "#{TYPE,jdbcType=INTEGER}, #{NAME,jdbcType=VARCHAR})"
    })
    int insert(WcVoteType record);

    @InsertProvider(type=WcVoteTypeSqlProvider.class, method="insertSelective")
    int insertSelective(WcVoteType record);

    @SelectProvider(type=WcVoteTypeSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="ID", property="ID", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="VOTE_ID", property="VOTE_ID", jdbcType=JdbcType.BIGINT),
        @Result(column="TYPE", property="TYPE", jdbcType=JdbcType.INTEGER),
        @Result(column="NAME", property="NAME", jdbcType=JdbcType.VARCHAR)
    })
    List<WcVoteType> selectByExample(WcVoteTypeExample example);

    @Select({
        "select",
        "ID, VOTE_ID, TYPE, NAME",
        "from wc_vote_type",
        "where ID = #{ID,jdbcType=BIGINT}"
    })
    @Results({
        @Result(column="ID", property="ID", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="VOTE_ID", property="VOTE_ID", jdbcType=JdbcType.BIGINT),
        @Result(column="TYPE", property="TYPE", jdbcType=JdbcType.INTEGER),
        @Result(column="NAME", property="NAME", jdbcType=JdbcType.VARCHAR)
    })
    WcVoteType selectByPrimaryKey(Long ID);

    @UpdateProvider(type=WcVoteTypeSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") WcVoteType record, @Param("example") WcVoteTypeExample example);

    @UpdateProvider(type=WcVoteTypeSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") WcVoteType record, @Param("example") WcVoteTypeExample example);

    @UpdateProvider(type=WcVoteTypeSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(WcVoteType record);

    @Update({
        "update wc_vote_type",
        "set VOTE_ID = #{VOTE_ID,jdbcType=BIGINT},",
          "TYPE = #{TYPE,jdbcType=INTEGER},",
          "NAME = #{NAME,jdbcType=VARCHAR}",
        "where ID = #{ID,jdbcType=BIGINT}"
    })
    int updateByPrimaryKey(WcVoteType record);
}